Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #22479 - Handle remote directory with undefined parent #410

Merged
merged 3 commits into from
Feb 26, 2018

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Feb 21, 2018

This can happen when tftp is set to false or unmanaged.

We move the remote_file define to this module since puppet-foreman no longer uses it itself. That will allow us to remove it there in a next major release.

it { should contain_foreman_proxy__plugin('discovery') }
it { should contain_foreman_proxy__feature('Discovery') }
it { should_not contain_foreman_proxy__remote_file("#{tftproot}/boot/fdi-image-latest.tar") }
it { should_not contain_exec('untar fdi-image-latest.tar') }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind of meta, but I think is_expected.to / is_expected.not_to is generally considered best practice these days.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I copied the spec from puppet-foreman and didn't replace it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: these was an existing file. I at least wanted to keep it consistent within this file.

creates => $parent,
}
-> exec {"retrieve_${title}":
command => "/usr/bin/curl -s ${remote_location} -o ${title}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is curl definitely going to be installed on all supported platforms?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated it to use the plain file resource for the download. Not sure how well that'll work in practice.

creates => $parent,
}
-> exec {"retrieve_${title}":
command => "/usr/bin/curl -s ${remote_location} -o ${title}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want to add --connect-timeout foo since your setting timeout => 0, below?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File doesn't expose a timeout setting so that may be tricky.

This can happen when tftp is set to false or unmanaged.

We move the remote_file define to this module since puppet-foreman no
longer uses it itself. That will allow us to remove it there in a next
major release.
creates => $parent,
}
-> file { $title:
source => $remote_location,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, forgot about that 👍

Copy link
Member

@sean797 sean797 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK - nice!

Copy link
Member

@sean797 sean797 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl if you don't mind can you copy the test from theforeman/puppet-foreman#627 ?

@ekohl
Copy link
Member Author

ekohl commented Feb 22, 2018

@sean797 Thanks! I modified it slightly and added a commit that enables acceptance tests.

Copy link
Member

@sean797 sean797 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, that failure looks like a random Travis one?

@ekohl
Copy link
Member Author

ekohl commented Feb 22, 2018

Rerunning to see if that helps

@ekohl ekohl requested a review from mmoll February 23, 2018 10:22
@ekohl
Copy link
Member Author

ekohl commented Feb 23, 2018

Pushed a fix that was also done in the voxpupuli nodeset

@mmoll
Copy link
Contributor

mmoll commented Feb 23, 2018

this still fails on Ubuntu?

@ekohl
Copy link
Member Author

ekohl commented Feb 23, 2018

Yes, not sure what's going on there. Doesn't look like an actual test failure but rather the whole image.

@ekohl
Copy link
Member Author

ekohl commented Feb 26, 2018

For now I just excluded the tests on Ubuntu because I couldn't figure it out.

@mmoll mmoll merged commit 7f65ad6 into theforeman:master Feb 26, 2018
@mmoll
Copy link
Contributor

mmoll commented Feb 26, 2018

merged, thanks @ekohl and @sean797!

@ekohl ekohl deleted the 22479-fix-dep branch February 26, 2018 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants